﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using FinancialManagement.Models.Repository;

namespace FinancialManagement.Controllers
{
    public class HomeController : Controller
    {
        private AccountRepository accountRepository = new AccountRepository();
        public ActionResult Index()
        {

            FormsAuthentication.GetAuthCookie(User.Identity.Name, true);
            
            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);

            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
